<?php
/*
 * This page is to show profile page for user.
 */
$tu = true;
include 'all.php';
?>

<?php include '../head.php'; ?>
<title>SMS to Family</title>

<body>
    <div id="wrapper">

        <?php include '../header_profile.php'; ?>
        <?php include '../menu_left.php'; ?>
        <?php include 'usr_menu.php'; ?>

        <div class="float_right" style="width: 210px">

        <!--        <div class="float_right top_after_menu"><a href="http://www.ndroid360.com/salus/index.php/salus_bank/gen_pdf"><img id="send_mail" src="http://www.ndroid360.com/salus/public/frontend/images/icons/send.png" title="Send Email"/></a></div>-->
            <form id="ffr" name="ffr" method="post" action="">

                <input type="hidden" id="maildata" name="maildata">
                <div class="float_right top_after_menu"><a href="<?= 'http://' . $_SERVER['HTTP_HOST'] . '/salusme/user/view/profile_print' ?>" ><img id="send_mail" src="../../include/images/send.png" title="Send Email"/></a></div>

            </form>
            <div class="float_right top_after_menu"><a><img onclick="PrintElem('#mainContent')" src="../../include/images/print.png" title="Print"/></a></div>
            <div class="float_right top_after_menu"><a href="#"><img src="../../include/images/import.png" title="Import"/></a></div>
            <div class="float_right top_after_menu"  style="width: 30px"><a href="profile_edit"><img src="../../include/images/edit_icon.png" title="Edit"/></a></div>
            <div class="float_right top_after_menu"><a href=""><img src="../../include/images/new.png" title="New"/></a></div>
        </div>

        <div class="clear"></div>

        <script>
            function checks()
            {
                var avail = false;
                if(document.forms['fm']['rl1'].checked){
                    avail  = true;
                }
                if(document.forms['fm']['rl2'].checked){
                    avail  = true;
                }
                if(document.forms['fm']['rl3'].checked){
                    avail  = true;
                }
                if(avail == false){
                    alert("Select at-least one relative.");
                    return false;
                }
            }
        </script>


        <div id="mainContent">                                              
            <hr>
            
            <?php
            if($_GET['s']){
                echo '<font color=green>'.$_GET['s'].'</font>';
            }
            if($_GET['e']){
                echo '<font color=red>'.$_GET['e'].'</font>';
            }
            ?>
            
            
            <form method="post" action="../profile/sms2family.php" onsubmit="return checks();" name="fm" >
                <b>Send a message to :</b>
                <?php
                $rel1 = mysql_query("select * from salus_user_profile_detail where FK_fa_user_id = '" . $_COOKIE['gid'] . "' ") or die(mysql_error());
                while ($row = mysql_fetch_array($rel1)) {
                    $rl1 = $row['RFN1'];
                    $rl2 = $row['RFN2'];
                    $rl3 = $row['RFN3'];

                    if ($rl1 != '') {
                        ?><br>
                        Relative 1 : &nbsp;         <input type="checkbox" id="rl1" name="rl1" value="<?= $row['RM1'] ?>" /> <?= $rl1 ?> (<?= $row['RM1'] ?>)<br>
                    <?php }
                    if ($rl2 != '') {
                        ?>
                        Relative 2 : &nbsp;         <input type="checkbox" id="rl2" name="rl2" value="<?= $row['RM2'] ?>" /> <?= $rl2 ?> (<?= $row['RM2'] ?>)<br>
                    <?php }
                    if ($rl3 != '') {
                        ?>
                        Relative 3 : &nbsp;        <input type="checkbox" id="rl3" name="rl3" value="<?= $row['RM3'] ?>" /> <?= $rl3 ?> (<?= $row['RM3'] ?>)<br> 
                    <?php
                    }
                }
                ?>

                <br>           
                <div class="color_blue" style="padding-top: 20px;padding-bottom: 10px">
                    Compiling SMS 
                </div>

                <div>
                    <div class="float_left sms_title"> Name doctor </div>
                    <div class="sms_profile_normal">
                        <input  type="text"  name="name_doctor" required />
                    </div>
                </div>

                <div>
                    <div class="float_left sms_title"> Name structure / rescue </div>
                    <div class="sms_profile_normal">
                        <input type="text"  name="name_struc" required/>
                    </div>
                </div>

                <div>
                    <div class="float_left sms_title"> N. Tel. Structure / rescue </div>
                    <div class="sms_profile_normal">
                        <input  type="text"  name="name_tell" required />
                    </div>
                </div>

                <input type="submit" value="Send" />
            </form>


        </div>

    </div><!-- wrapper over    -->
    <?php
    include '../../include/config.php';
    include '../menu_right.php';
    ?>
</body>
</html>